//********************************************************************************
//
// File :           pp01_helloworld.cpp
//
// Description :    hello world
//
// Dependencies:    
//
// Author :         UlMonkey1987( WU Kan )
//
// Date :           2011-3-16
//
//********************************************************************************

#include "mpi.h"

#include <iostream>
#include <string>

using namespace std;

int main( int argc, char* argv[] )
{
    // initialize
    MPI_Init( &argc, &argv );

    // get process id
    int id;
    MPI_Comm_rank( MPI_COMM_WORLD, &id );
    //

    // get host name
    const int HOST_NAME_LEN = 256;
    char hostName[HOST_NAME_LEN];
    gethostname( hostName, HOST_NAME_LEN );
    string strHostName( hostName );
    //

    // output
    cout << "Hello World" << id << " From " << strHostName << endl << endl;
    //

    // exit
    MPI_Finalize();
    //

    return 0;
}






